package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.KeywordPageQueryDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveController {
    @Autowired
    WmSensitiveService wmSensitiveService;
    @DeleteMapping("/del/{id}")
    public ResponseResult del(@PathVariable Integer id){
        return wmSensitiveService.del(id);
    }
    @PostMapping("/list")
    public ResponseResult list(@RequestBody KeywordPageQueryDto dto){
        return wmSensitiveService.pageQuery(dto);
    }
    @PostMapping("/save")
    public ResponseResult save(@RequestBody WmSensitive sensitive){
        return wmSensitiveService.add(sensitive);
    }
    @PostMapping("/update")
    public ResponseResult update(@RequestBody WmSensitive sensitive){
        return wmSensitiveService.update(sensitive);
    }
}
